package cn.itcast.config;

import cn.itcast.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class MyApplicationRunner implements ApplicationRunner {

    @Autowired
    private SetmealService setmealService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        // 调用service方法更新所有静态页面
        System.out.println("正在生成静态页面！");
        setmealService.init();
    }
}